
package org.igeek.atomqq.widget;

import org.igeek.atomqq.R;
import org.igeek.atomqq.domain.Friend;

import android.content.Context;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import android.view.animation.Animation;
import android.view.animation.AnimationUtils;
import android.view.animation.Interpolator;
import android.widget.AbsoluteLayout;
import android.widget.FrameLayout;
import android.widget.ImageView;


/** 
 * 模仿QuickContactBadge
 * @author <a href="http://hangxin1940.cnblogs.com">hangxin1940@gmail.com</a>
 * @time 2012-2-6 下午03:43:55 
 */
public class FriendBadgeView extends BadgeView {
	private final static int _HEIGHT=84;
	
	private ImageView ivArowUp; 
	private ImageView ivArowDown; 
	private Friend friend;
	
	
        
	
	public FriendBadgeView(Context context,Friend friend) {
		super(context);
		
		
		//填充布局
		LayoutInflater infater=(LayoutInflater) getContext().getSystemService(Context.LAYOUT_INFLATER_SERVICE);
		infater.inflate(R.layout.widget_quickbadge_friend, this, true);
		
		ivArowDown=(ImageView) findViewById(R.id.widget_quickbadge_ivArrowDown);
		ivArowUp=(ImageView) findViewById(R.id.widget_quickbadge_ivArrowUp);
		
		this.friend=friend;
	}
	
	

	@Override
	public void setDownArow(int x) {
		ivArowDown.setVisibility(View.VISIBLE);
		ivArowUp.setVisibility(View.GONE);
		
		FrameLayout.MarginLayoutParams param = (FrameLayout.MarginLayoutParams) ivArowDown.getLayoutParams();
		param.leftMargin=x;
	
	}

	@Override
	public void setUpArow(int x) {
		
		ivArowDown.setVisibility(View.GONE);
		ivArowUp.setVisibility(View.VISIBLE);
		
		FrameLayout.MarginLayoutParams param = (FrameLayout.MarginLayoutParams) ivArowUp.getLayoutParams();
		param.leftMargin=x<10?10:x;
	}


	public int getCustomHeight(){
		return _HEIGHT;
	}

}
